Human-AI ecosystem with abrupt changes as a function of the composition

The progressive advent of artificial intelligence machines may represent both an opportunity or a threat. In order to have an idea of what is coming we propose a model that simulate a Human-AI ecosystem. In particular we consider systems where agents present biases, peer-to-peer interactions and also three body interactions that are crucial and describe two humans interacting with an artificial agent and two artificial intelligence agents interacting with a human. We focus our analysis by exploring how the relative fraction of artificial intelligence agents affect that ecosystem. We find evidence that for suitable values of the interaction parameters, arbitrarily small changes in such percentage may trigger dramatic changes for the system that can be either in one of the two polarised states or in an undecided state.


Introduction
Artificial Intelligence (AI) is the property of human-made systems with specific or general goals and the ability to perceive and process information from their environment, to take action towards achieving their goals. Fields of applications include understanding human speech, pattern recognition, recommendation systems, navigation, health care, military and many more [1]. Such systems have become ubiquitous during the recent decades and are influencing our lives in many ways. Consciously or not, human-AI interactions have become natural in several domains like e-commerce, medical diagnostics, self-driven vehicles or online social networks.
The economic, sociological and ethical aspects of this emergent, complex human-AI ecosystem are of eminent interest, yet, we are only at the beginning of their investigation and even finding the right questions and approaches are challenging tasks. Unavoidably, complexity science should have a significant role in the endeavor of exploring this "terra incognita". Using its tools ranging from non-linear dynamics to network science and the theory of collective phenomena we have learned much about the human society [2]. Extending the results to the human-AI system and discovering the related new phenomena will be the goals of the period ahead.
Our main focus here stems from a paramount consideration of historical perspective. It is expected that the advent of machines that cover part of the intellectual activities of humans (AI agents) is as unavoidable as the advent of those machines that came to help our physical work during the industrial revolution. At that time, in fact, the production of work from energy started to be shifted from the human and animal body to that of combustion engines. The progressive lowering of costs of both energy sources and work production from those machines pushed toward an unavoidable increase in their number. The lowering costs of information processing and the parallel increase of their abilities up to the modern deep learning marvels is analogously pushing the increase of their number and frequency of use. A specific problem we are interested in is understanding how the Human-AI ecosystem reacts therefore to an increase of the relative fraction of machines α. In particular, will the ecosystem react smoothly or abruptly? In the first scenario humans can optimize the outcomes by feedback while in the second there could be irreversible consequences.
Our plan is to describe the Human-AI ecosystem using the complex systems, statistical physics approach which has a well developed framework to spot abrupt changes and phase transitions.
Complex systems consist of interacting agents spanning a network. In social systems the nodes are individuals and the links between pairs of them stand for the different kinds of relationships humans may have. Recently the importance of so-called higher order interactions has been emphasized [3][4][5], where interactions beyond pairs are considered and processes on such networks have been studied, including opinion dynamics. From the mathematical point of view such generalization implies going from a simple graph-theoretical setting of vertices and edges to a more complex hyper-graph environment where also three-body terms faces or higher are considered. For example, in social systems the binding of a triple is significantly different from the sum of three links between its components. Analogously the presence of different types of agents, i.e. the nature of the agent inhabiting a node, represents a further element of complexity to be considered (see for instance [6]).
In the present paper we focus on ecosystems with both humans and AI agents with the presence of binary and higher order interactions. There are several reasons why such a system cannot be discussed in its full complexity. There is no generally accepted model of the problem, and we are not aware of the details of the interactions. In such a situation there are two main and in some sense opposite routes of theoretical approaches. First, one can set up a complex agent-based model where the numerous parameters can be target of a complex fitting procedure [7] to mimic behaviour which is thought to be reasonable. Second, one can chose an oversimplified model, where some basic elements of the original problem are present and where the analytical approach can be pushed to its limits. We can expect from such a model insight into the qualitative behaviour of the system, information about possible phases and the transitions between them. We follow in this paper the second route.
The first approach of this type can be traced back to Daniel McFadden's Discrete Choice theory [6]. It is possible to show indeed that such theory is equivalent to a multi-populated model without interaction or, in other words, a model of independent agents belonging to a finite number of groups [8]. In that model each agent aims to optimize its utility function up to some fluctuation of logistic type. In [9][10][11] the model, for a single group case, was generalized to include a mean field interaction between agents. A full interacting generalization of the McFadden model to the multi-group case came in [12][13][14][15] where specific case studies were investigated. It is important to emphasize that, for all the mentioned examples, the Gibbs distribution is only a working hypothesis to be used as a possible guide and, at best, to be tested against data: a distribution is assumed and the free parameters it depends on are statistically inferred. For an information theoretical perspective see [16][17][18].
As the starting point we have chosen the Ising model [19], the fundamental model of statistical physics, which was originally designed to describe the paramagnetic-ferromagnetic phase transition. It consists of agents with binary state variables represented by nodes of a network, interacting with their neighbors, where interactions prefer alike or opposite states. A transition probability of the state variables depending on the neighbors' states and the noise level (temperature) completes the definition of the model. Later on we will define the model in mathematical terms. The Ising model has been solved analytically in the limit of large number of agents on the complete graph (mean-field solution) and on two-dimensional lattices. Here solution means the description of the system in its equilibrium, stationary state. It is worth noticing that Ising models with cubic interaction were studied in [20] in the context of occupation number variables (i.e. taking 0 and 1 values). In that study, the phase diagram and the segregation kinetics of a system of particles on a two-dimensional square lattice were investigated. The Ising model has been extensively used for modelling social phenomena [21].
In this work we extend the original mean-field Ising model in two ways. First, we have introduced two kinds of agents for humans and AI units, both having binary state variables, but the interaction between the different types of agents can be different. It should be noted that such a generalization to a two-component model has been studied earlier in a different context [22,23]. Furthermore, we introduce higher order interactions to investigate the effects mentioned above. Our task is to calculate the phases and the transitions between them as a function of the coupling parameters and, especially, of the relative size of the two components that we call α 2 [0, 1]. When α = 1/2 the two groups, for instance Human and AI would be of the same size, α = 0 would mean only Human agents are present and vice versa α = 1 only AI. Our aim is to gain insight into the possible behaviour of the human-AI ecosystem.
The paper is organized as follows. In the next section, we define the mathematical model with three-body interaction. The third section is devoted to the exploration of the results. We describe the solution with one component, and solve the two-component model. The analysis of the phases, and the determination of the order of the transitions are also discussed in the same section. General remarks and perspectives are discussed in the final section Conclusion and Outlook.

The model and mathematical results
The human-AI ecosystem is an interacting system with two components, i.e., two kinds of entities. There are many ways to model mathematically such a system, depending on the characterization of the entities, the types of interactions, and the topology of the interactions. Our choice has been governed by the following viewpoints. We wanted to have an analytically tractable model, as such a solution enables general conclusions and qualitative predictions. Furthermore, we wanted to work with a model, which is closely related to standard theoretical models to be able to tie in with traditional techniques and results. Our choice has been a specific class of solvable Ising models that we can analytically control and make qualitative predictions with. Applications of the same class of models have been used in different fields such as health [12], immigration [8,14,24], education [15], energy conservation [25], and protein structure [26], among others. The paradigm we're considering therefore doesn't have to be understood as strictly typical to AI and Human agents; it is rather a flexible analytical guide to a variety of phenomena characterised by ecosystems of multi-components interacting agents.
The interactions that will be taken into account are the binary, quadratic ones (H-H, H-AI and AI-AI), the triplet or cubic (AI-AI-AI, AI-AI-H, AI-H-H, H-H-H) while the higher order ones (quartic, etc.) will be ignored. Furthermore, we consider the state (or opinion) variables of the agents as binary having in mind a task with possible binary outcome, like should a patient be operated or not. The nature of the interaction is that two or more agents in contact may like (or dislike) each others "opinion" and they change their state variables such that the system finds a stationary state. We assume that all agents are in contact with each other, i.e., they sit on the nodes of a complete graph-an assumption needed for the analytical solvability of the system. The model described above can be formulated mathematically as follows. Let us consider a system of N interacting agents, where each agent i has an internal degree of freedom described by a spin variable σ i 2 {−1, 1} that represents the agent's opinion. A configuration of the system is then determined by a vector σ 2 S N = {−1, 1} N . The class of models we are interested in is described by a Hamiltonian function or cost function of the following form where K i,j,k , J i,j are families of real parameters that tune the interactions among agents and the h i tunes the bias of each agent. Eq (1) is the Hamiltonian of the Ising model with two-body and three-body interactions. Eq (1) is very general and it naturally includes the possibility of describing a two-component system, like the Human-AI ecosystem. The parameter J i,j tunes the interaction among the couple of agents, while the K i,j,k those among triples. The positivity of those parameters imply, for the GKS inequalities [27][28][29], that the configurations with aligned opinions are the favored ones. The collective properties of the equilibrium state of the system are codified by a Boltzmann-Gibbs type probability distribution, related to the cost function (1) where the normalization factor, Z N also called the partition function, is used to compute the generating function of the moments for the previous distribution (2) which coincides, up to a multiplicative factor, with the free energy of the model. Clearly, the large N behaviour or thermodynamic limit (TDL) of p N depends on the choice of the parameters of the Hamiltonian (1). In the sequel we will show how to represents the large number limit of p N as a finite dimensional variational problem in two specific mean-field cases.

The one component cubic mean-field model
In the sequel we consider only mean-field interaction among agents, i.e. we make the assumption based on the full permutation symmetry among agents, K i,j,k = K/3N 2 , J i,j = J/2N and h i = h. The resulting model turns out to be a cubic mean-field model: where m N ðsÞ ¼ 1 N P N i¼1 s i is average opinion. In Eq (4) K and J are the cubic and binary couplings, respectively, and h is the uniform bias. A remarkable fact about the considered model is that it may be solved exactly [30] by means of the large deviations technique, a method developed in [31]. One can prove that the large limit number of the generating functional (3) related to the Hamiltonian (4) admits the following variational representation: where ϕ(m) = U(m) − I(m) with is the energy contribution and is the entropy contribution, expressing the logarithm of the number ways the value m can be produced with different σ configurations. The structure of the probability measure identified by the variational principle (5) select stable solutions, i.e. a small stochastic disturbance of the system will produce small changes on the opinions unless the system is close to a second order phase transition.
The solutions of the variational principle (5) must satisfy the stationarity condition the equation can be solved [30] by means of the local fixed-point method. Among those solutions we are only interested in the ones that realize the supremum of ϕ in (5) since they represent the overall opinion of the system with respect to the measure (2) in the equilibrium state. The quantity � m is called the order parameter of the model. The overall phase picture that emerges presents novel features.
Unlike the quadratic mean field model that, for h = 0, has a second order continuous phase transition in J, the cubic case analyzed here displays a remarkable discontinuous first order phase transition in K when J = h = 0 shown in Fig 1. Starting from small absolute valued K-s and increasing or decreasing it, the value � m characterizing the stable stationary solution remains at zero until K = K c � ±2.016295 where suddenly we observe a jump in the order parameter.
The behaviour of the order parameter in the planes (K, J, 0) and (K, 0, h) is shown in Fig 2, while the case (0, J, h) correspond to the classical two-body mean-field model. From panel (a) one can observe the presence, for J < 1, of three distinct phases: the one with negative average opinion (in blue), the one with zero average opinion (in gray) and the one with positive average opinion (red). In that region therefore a progressive increase in K from negative to positive values encounter two consecutive jumps.

The two component cubic mean-field model
Our main interest is to understand the behaviour of a system consisting of two kinds of agents, corresponding to AI and H. To this end we investigate the two component version of the model in Eq (1), defined as follows. Let partition the system of N agents into two subsystems AI and H of sizes N 1 and N 2 respectively, such that AI \ H = ; and N 1 + N 2 = N. Let m S ðsÞ ¼ 1 jSj P i2S s i be the average opinion of agents in a subsystem S and denote m 1 and m 2 as the average opinion for the subsystems AI and H respectively. Further, we define as the relative sizes of AI and H agents a 1 ¼ N 1 N and a 2 ¼ N 2 N respectively. The two component cubic mean-field model has the following energy contribution:  The variational form of the large number limit of the generating functional (3) associated to the two component cubic mean-field model (9) is [30]: where I(m 1 ) and I(m 2 ) are the entropy associated to the average opinions of the subsystems and they sum up to the total number of configurations as a product of the individual ones. The stationary solutions � m of F are as follows from which the global stable ones are to be selected. In the rest of this work, we assign α = α 1 and (1 − α) = α 2 then α 2 [0, 1] and the total average opinion � m ¼ a � m 1 þ ð1 À aÞ � m 2 will be used as combined order parameter. It is worth recalling that, when α = 0 then there are only Human agents in the population and when α = 1 there are only AI agents in the population. For the rest of the work, we adopt the re-parameterisation of h 1 and h 2 found in [22]. In this sense, the parameters h 1 and h 2 are thought of as dependent on the internal average opinion (given by m � 1 and m � 2 ) and interaction within each subsystem without interaction with the other agents. Hence following the fixed point method, we define h 1 and h 2 as follows; Surfaces of the solution of (11) that gives rise to the global maxima of F in Eq (10), with respect to the free parameters α and K 112 = K 122 = K for fixed values of the other parameters are shown as  AI machines are made to assist and work with humans, therefore they are assumed to interact with humans. Fig 4 gives the scenario of an interacting system where only Humans or only AI agents are not interacting among themselves (see panel (a)) and when we assume that the cubic interaction among humans and AI agents are equal (see panel (b)). In both cases we observe transitions for large enough fraction of the AI agents in the order parameter when interaction bias and mutual interaction are absent.

Exploration of the effect of the composition
In this section we present phase diagrams of the model relating the parameter α and one among the interacting ones. The black continuous line is used to separate the opinion phases and in particular it emphasises the first order phase transitions, i.e. sudden jumps of the opinion resulting in abrupt changes of color in the picture. This is illustrated in Fig 5. The α-value found in correspondence of the black line indicates the proportion of AI agents required for Human opinion to lose its prevalence over the entire population.
The simulation of the results obtained for suitable values of the model parameter in Fig 5(a) suggest that even in the case where there is very small fraction of AI agents we can still observe abrupt behaviours in opinion formation within the Human AI ecosystem. This observation is likewise similar to that of panel (d) of Fig 5, which illustrate that for a system where there is less interaction among Human agents (K 222 ), smaller fraction of the AI agents may lead to phase transition and hence prevalent opinion formation.

Conclusion and outlook
The rapid spread of AI raises sharply the question of the relationship between humans and machine intelligence. How far can we control this development? Will we become vulnerable or will we succeed in humanising this new form of collaboration [32]? In fact, the problems are already all around us. What happens when AI and human participants in a medical consultation take different positions? Can trust or reticence develop between representatives of With the advancement of AI systems, there are growing concerns among scientists and psychologists about the creation of a machine world with AI and its eventual replacement of people in the labour force [33,34]. In light of this possible occurrence, the following works [35][36][37][38][39][40] advise users and developers, as well as humans in general, to take an ethical approach to the design and use of these AI technologies, ensuring that humans are at the center of the algorithms with AI machines.
Notwithstanding these important factors, AI machines are needed to meet our daily needs as humans. To illustrate the significance of this study, let us first consider the undoubted benefit of AI machines to our healthcare system. Starting from chronic diseases and cancer to radiography and risk assessment, there are virtually endless opportunities to leverage technology to deliver more precise, efficient, and forceful interventions at precisely the appropriate  In panel (a), when K 112 = K 122 is small the system require a larger fraction (i.e. α) of the AI agents to observe a phase transition and as K 112 = K 122 increases, the proportion of AI agents required for a phase transition decreases. In this scenario, the relative fraction of the AI agents corresponding to the black line is a decreasing function of K 112 = K 122 . While panel (b) illustrate two separate jumps in the average opinion depending on the values of K 112 = K 122 and α. We observe from panel (c) that when interaction among AI agents (K 111 ) increases their proportion needed to observe a phase transition decreases. While in panel (d), when interaction among Human agents (K 222 ) increases, the fraction of AI agents needed to effect a phase transition increases and vice versa.
https://doi.org/10.1371/journal.pone.0267310.g005 PLOS ONE moment in a patient's care. Given the massive amount of data accessible, artificial intelligence is clearly positioned to be the primary engine that will propel our healthcare system forward as need dictates.
In this study we propose a simple, analytically solvable, mathematical model with higher order interaction that seeks to model the complex interactions between humans and AI agents. Using this model we predict and emphasize some crucial features of the system that are triggered on its composition i.e. the proportion of AI participating in a joint decision with us. This aspect is especially important in the light of the new tendency toward distributed AI, when the interaction of a large number of AI units is be more the standard than the exception [41]. The model utilized here has the potential to forecast the likely outcome in opinion formation (such as whether a patient should be operated on or not) for a certain proportion of AI or Human agents as they interact. Abrupt changes, known as discontinuous phase transitions in statistical physics, may predict thresholds beyond which AI machines may gain control prevalence. Experts in human-computer interaction, industries, institutions, psychologists, and others who work with AI machines may rely on the use of these models to set boundaries in order to achieve the desired and ethical benefit to humans while reducing its negative impact. The simulations conducted with our model (see Fig 5) show that a seemingly modest proportion of AI agents may lead to their prevalence in opinion formation over humans.
A noteworthy feature of the cubic mean-field model stems from the fact that we can observe three distinct phases depending on the parameter values in the absence of interaction bias of the agent(s) in the ecosystem (see for instance Figs 2(a), 3(a) and 4). Unlike the quadratic mean-field model, where we observe a jump from negative to positive state, instead one can observe a jump from the negative average opinion to a zero average opinion and a jump to a positive average opinion when three body interaction is considered. The zero average opinion, which is a stable paramagnetic state, is an indication of symmetry in opinion such that the agents have no preference for one over the other. As K increases or decreases, the symmetry in opinion is broken, and the total average opinion of the agents in the ecosystem shifts to either a positive or negative state.
The results illustrated in this work are some of the possible simulation for a wide class of values of the parameters. The model used and the whole statistical mechanics approach presented might also be used to infer the values of those parameters starting from real data as it was done in [12,[13][14][15].
Clearly, our approach has limitations. First, the dynamics leading to the stationary statistical distribution described by Eq (3) is a special one, while in reality opinion dynamics may be quite different as reflected in the numerous models introduced to study it [42]. However, we believe that our simplified model is sufficient for calling the attention to a possible source of criticality, namely that the dependence of the outcome in an AI/H ecosystem depends very non-linearly on the composition of the participants and this may have severe consequences.
A further aspect is that in realistic settings time should play an important role, which has been completely ignored here. With reference to the example above about the decision making process in a critical situation in health care, there is probably not enough time to achieve a complete equilibrium state of the participating opinion carriers. Another source of non-stationarity could be that the system is driven by a continuous flow of data. Therefore, more realistic models have to be dynamic in nature.
The above critical points give a guide to us in which direction one should continue the research on the Human-AI ecosystem. An important step should be to collect and use data of related systems as a starting point for the developments of adequate models.